<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8" />
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <style type="text/css">
    body {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100vh;
      background-color: #f8f9fa;
    }
    .form-container {
      width: 100%;
      max-width: 400px;
      padding: 15px;
      margin: auto;
      background-color: #fff;
      border: 1px solid #dee2e6;
      border-radius: 5px;
      box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    .form-container .btn-group {
      width: 100%;
    }
    .form-container .btn-group button,
    .form-container .btn-group a {
      width: 49%;
    }
    .form-container .btn-group a {
      margin-left: 2%;
    }
  </style>
  <title>动物园管理系统--登录</title>
</head>
<body>
<div class="form-container">
  <div class="text-center mb-4">
    <h1 class="h3 mb-3 font-weight-normal">动物园管理系统</h1>
  </div>
  <form action="login" method="post">
    <div class="form-group">
      <label for="inputUsername">用户名</label>
      <input type="text" class="form-control" id="inputUsername" name="username" placeholder="用户名" required autofocus>
    </div>
    <div class="form-group">
      <label for="inputPassword">密码</label>
      <input type="password" class="form-control" id="inputPassword" name="password" placeholder="密码" required>
    </div>
    <div class="form-group">
      <label for="selectRole">用户类型</label>
      <select class="form-control" id="selectRole" name="userType">
        <option value="1">用户</option>
        <option value="2">员工</option>
        <option value="3">管理员</option>
      </select>
    </div>
    <div class="text-danger mb-3">${errorMessage}</div> <!-- 显示错误信息 -->
    <div class="btn-group">
      <button type="submit" class="btn btn-primary">登录</button>
      <a href="register.jsp" class="btn btn-secondary">注册</a>
    </div>
  </form>
</div>
</body>
</html>
